package com.ls.controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ExceptionController {
    @ExceptionHandler(NullPointerException.class)
    public String exHandler(Exception e, Model model) {
        model.addAttribute("ex", e);
        return "error";
    }

}
